import requests

# curl --location 'https://qtoss-connect-dev.azurewebsites.net/token' \
# --header 'Content-Type: application/json' \
# --header 'Authorization: Basic YWRtaW5AZ21haWwuY29tOjEyMzQ1Ng==' \
# --data-raw '{
#   "firstName": "Haiping",
#   "lastName": "Chen",
#   "email": "admin@gmail.com",
#   "password": "123456"
# }'

url = "https://qtoss-connect-dev.azurewebsites.net/"
import json

def login():
    data={
  "firstName": "Haiping",
  "lastName": "Chen",
  "email": "admin@gmail.com",
  "password": "123456"
}
    res = requests.post(url=url+'/token',headers={'Content-Type': 'application/json','Authorization':'Basic YWRtaW5AZ21haWwuY29tOjEyMzQ1Ng=='},data=data)
    res = json.loads(res.text)
    return res['access_token']

token = login()
token = 'Bearer '+token
tt = requests.get(url="https://qtoss-connect-dev.azurewebsites.net/gtoss-conntct/tiktok/11",headers={'Content-Type': 'application/json','Authorization':token})
# res = json.loads(tt.text)
print(tt)